import request from '@/utils/request';

// 获取当前用户的专家预约列表
export function getMyAppointments(userId) {
  return request({
    url: `/api/appointments/user/${userId}`,
    method: 'get',
  });
}

// 获取专家的所有预约
export function getExpertAppointments(expertId) {
  return request({
    url: `/api/appointments/expert/${expertId}`,
    method: 'get',
  });
}

// 更新预约（审核/备注）
export function updateAppointment(data) {
  return request({
    url: `/api/appointments/${data.id}`,
    method: 'put',
    data,
  });
}

// 取消预约
export function cancelAppointment(id) {
  return request({
    url: `/api/appointments/${id}`,
    method: 'delete',
  });
}

// 创建预约
export function createAppointment(data) {
  return request({
    url: '/api/appointments',
    method: 'post',
    data,
  });
} 